import request from '@/utils/request'
// #region 追溯
// 获取生产清单
export function getAbnormalList(query) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1300, para: query }
  })
}
// 获取生产清单
export function getAbnormalReasonCount(query) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1301, para: query }
  })
}
// 获取每站的合格率
export function getAbnormalPartCountOfStation(query) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1310, para: query }
  })
}
// #region 不合格项目定义
// 获取合格定义清单
export function getFailList(query) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1320, para: query }
  })
}
// 创建一个不合格项目
export function creatFail(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1321, para: val }
  })
}
// 更新一个定义
export function updateFail(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1322, para: val }
  })
}
// 删除一个定义
export function deleteFail(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1323, para: val }
  })
}
// 计算Cpk
export function CaculateCpk(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1330, para: val }
  })
}
// 下载不合格
export function downloadFailList(val) {
  return request({
    url: '/web/rmes',
    method: 'post',
    data: { eventId: 1605, para: val }
  })
}
// 获取子不合格列表
export function getSubFailList(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1340, para: val }
  })
}
// 新增子不合格列表
export function creatSubFailList(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1341, para: val }
  })
}
// 更新子不合格列表
export function updateSubFailList(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1342, para: val }
  })
}
// 删除子不合格列表
export function deleteSubFailList(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1343, para: val }
  })
}
// 上传缺陷
export function uploadDefect(val) {
  return request({
    url: '/web/rework',
    method: 'post',
    data: { eventId: 1350, para: val }
  })
}

